<?xml version="1.0" encoding="UTF-8"?>

<!--
    Document   : productListMain.xsl
    Created on : January 26, 2013, 6:34 PM
    Author     : trungnm
    Description:
        Purpose of transformation follows.
-->


<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0">
    <xsl:output method="html"/>

    <!-- TODO customize transformation rules
         syntax recommendation http://www.w3.org/TR/xslt
    -->
    <xsl:template match="/">
        <xsl:for-each select="products/product">
            <xsl:sort select="productID" data-type="number" order="descending"/>
            <xsl:if test="not(position()>15)">
            <form method="GET" action="Controller">
                <li class="content">
                    <div class="image-product-wrapper" align="center">
                        <div class="image-product">
                            <img width="100%" height="100%">
                                <xsl:attribute name="src">Pictures/xmlImg/<xsl:value-of select="productImg"/>
                                </xsl:attribute>
                            </img>
                        </div>
                    </div>
                    <div class="info-product-wrapper">
                        <div class="productID" style="display:none">
                            <xsl:value-of select="productID"/>
                        </div>
                        <div class="productName" style="display:inline">

                            <xsl:value-of select="productName"/>
                        </div>
                        <div class="productPrice" align="right">
                            <xsl:value-of select="price"/>
                        </div>
                    </div>
                    <div class="button-action">
                        <button type="button" name="btnAction" value="viewdetail" onclick="viewDetail(this)">Xem chi tiết</button>
                        <button type="button" name="btnAction" value="AddCart" onclick="addCart(this)">Thêm giỏ hàng</button>
                    </div>
                </li>
            </form>
            </xsl:if>
        </xsl:for-each>
    </xsl:template>
</xsl:stylesheet>
